#pragma once

#include <qbprotocol/include/SSQBModel.h>

#include <map>
#include <mutex>
#include <set>
#include <string>
#include <vector>

#include "bondlib.h"

class S_BONDLIB_EXPORT SectorBond {
 public:
  enum sector {
    sector_green = 0,
    sector_society,
    sector_sustanable,
    sector_small_corp,
    sector_innoation_corp,
    sector_panda,
    sector_max
  };

  static SectorBond& instance();

 public:
  void ClearData();
  bool IsInSector(int nIndex, const char* comBondCode);
  void UpdateData(SectorBondAck* pData);
  const std::vector<std::string>& GetSectorVector() const {
    return m_sectorVector;
  }

 private:
  SectorBond();
  ~SectorBond();

 protected:
  std::map<std::string, std::set<std::string>> m_data;  // section_id, data
  // std::map<int, set<string>>	 m_BondIndexToSecotor;

  std::vector<std::string> m_sectorVector;
  std::mutex m_mutex;
};